<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>计算红、白、黑三种球各有多少个</title>
</head>
<body>

<script type="text/javascript">
    /**
     * @Description: 
     * @author 朱志文
     * @date 2021/9/17
    */
    /*选择红球作为标准*/
    for (let red = 0; red < 32; red++) {
        var white=25-red;
        var black=28-red;
        /*判断红白黑的数量*/
        if (white+black==31){
            /*打印输出*/
            document.write("红球: "+red)
            document.write(",白球: "+white)
            document.write(",黑球: "+black)
        }
    }
</script>
</body>
</html>